package com.spice.service;

import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.embedded.tomcat.TomcatServletWebServerFactory;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@EnableScheduling
@SpringBootApplication
@MapperScan("com.spice.service.mapper")
@EnableTransactionManagement(proxyTargetClass = true)
public class SpiceApplication {
    public static void main(String[] args) {
        SpringApplication.run(SpiceApplication.class, args);
    }

    @Bean
    public TomcatServletWebServerFactory mbeddedServletContainerFactory() {
        TomcatServletWebServerFactory tomcatEmbeddedServletContainerFactory = new TomcatServletWebServerFactory();
        tomcatEmbeddedServletContainerFactory.addConnectorCustomizers(connector -> {
            connector.setMaxParameterCount(1);
        });
        return tomcatEmbeddedServletContainerFactory;
    }
}
